/**
 Queue 是队列接口  实现类  LinkedList
 先进 先出  后面排队 
 DEque 双端 2边都能进出 
 */
/*
package com.leo.第九章_集合;

import java.util.ArrayList;
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
import java.util.Stack;

public class U9_L14_Queue_Deque接口_Stack {
	
	public static void main(String [] args) {
		queue();
		deque();
		stack();
	}
	
	private static void queue() {
		System.out.println("--------queue----------");
		Queue<String> q=new LinkedList<>();
		q.add("red");
		q.add("white");
		q.add("black");
		System.out.println("peek:->"+q.peek());
		q.poll();
		q.forEach(System.out::println);
		
	}
	private static void deque() {
		System.out.println("--------deque----------");
		Deque<String> d=new LinkedList<>();
		d.add("red");
		d.add("yellow");
		d.addFirst("no.1");
		d.addLast("no.last");
		d.forEach(System.out::println);
		System.out.println("peeklast:->"+d.peekLast());
		System.out.println("peekFirst:->"+d.peekFirst());
		System.out.println("pollfirst:->"+d.pollFirst());
		System.out.println("polllast:->"+d.pollLast());
		d.forEach(System.out::println);
	}
	private static void stack() {
		System.out.println("--------stack----------");
		Stack stack=new Stack();
		stack.add("red");
		stack.add("black");
		stack.add("yellow");
		stack.add("withe");
		stack.pop();  //stack专用 先进最后出 后面进最后的出 和杯子一样  
		stack.forEach(System.out::println);
	}
}
*/